package com.daxiong.model;

import java.io.Serializable;

/**
 * 商品信息
 *
 * @author sunyanxiong
 * @date 2017/4/28
 */
public class SpInfo implements Serializable {

    private String id;
    private String productName;
    private String shortName;
    private String productArea;
    private String unitMeasure;
    private String standard;
    private String packWrap;
    private String batchNum;
    private String approvalNum;
    private String memo;
    private String gysName;

    public SpInfo() {

    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }

    public String getProductArea() {
        return productArea;
    }

    public void setProductArea(String productArea) {
        this.productArea = productArea;
    }

    public String getUnitMeasure() {
        return unitMeasure;
    }

    public void setUnitMeasure(String unitMeasure) {
        this.unitMeasure = unitMeasure;
    }

    public String getStandard() {
        return standard;
    }

    public void setStandard(String standard) {
        this.standard = standard;
    }

    public String getPackWrap() {
        return packWrap;
    }

    public void setPackWrap(String packWrap) {
        this.packWrap = packWrap;
    }

    public String getBatchNum() {
        return batchNum;
    }

    public void setBatchNum(String batchNum) {
        this.batchNum = batchNum;
    }

    public String getApprovalNum() {
        return approvalNum;
    }

    public void setApprovalNum(String approvalNum) {
        this.approvalNum = approvalNum;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getGysName() {
        return gysName;
    }

    public void setGysName(String gysName) {
        this.gysName = gysName;
    }

    // 只返回 productName;
    @Override
    public String toString() {
        return getProductName();
    }

    // 重写 hashCode()
    @Override
    public int hashCode() {
        final int PRIME = 31;
        int result = 1;
        result = PRIME * result + ((null == id) ? 0 : id.hashCode());
        result = PRIME * result + ((null == productName) ? 0 : productName.hashCode());
        result = PRIME * result + ((null == shortName) ? 0 : shortName.hashCode());
        result = PRIME * result + ((null == productArea) ? 0 : productArea.hashCode());
        result = PRIME * result + ((null == unitMeasure) ? 0 : unitMeasure.hashCode());
        result = PRIME * result + ((null == standard) ? 0 : standard.hashCode());
        result = PRIME * result + ((null == packWrap) ? 0 : packWrap.hashCode());
        result = PRIME * result + ((null == batchNum) ? 0 : batchNum.hashCode());
        result = PRIME * result + ((null == approvalNum) ? 0 : approvalNum.hashCode());
        result = PRIME * result + ((null == memo) ? 0 : memo.hashCode());
        result = PRIME * result + ((null == gysName) ? 0 : gysName.hashCode());
        return result;
    }

    // 重写 equals()
    @Override
    public boolean equals(Object object) {
        if (object == this) {
            return true;
        }
        if (null == this) {
            return false;
        }
        if (object.getClass() != getClass()) {
            return false;
        }

        final SpInfo spInfo = (SpInfo) object;
        if (null == id) {
            if (null != spInfo.id) {
                return false;
            }
        } else if (!id.equals(spInfo.id)) {
            return false;
        }

        if (null == productName) {
            if (null != spInfo.productName) {
                return false;
            }
        } else if (!productName.equals(spInfo.productName)) {
            return false;
        }

        if (null == shortName) {
            if (null != spInfo.shortName) {
                return false;
            }
        } else if (!shortName.equals(spInfo.shortName)) {
            return false;
        }

        if (null == productArea) {
            if (null != spInfo.productArea) {
                return false;
            }
        } else if (!productArea.equals(spInfo.productArea)) {
            return false;
        }

        if (null == unitMeasure) {
            if (null != spInfo.unitMeasure) {
                return false;
            }
        } else if (!unitMeasure.equals(spInfo.unitMeasure)) {
            return false;
        }

        if (null == standard) {
            if (null != spInfo.standard) {
                return false;
            }
        } else if (!standard.equals(spInfo.standard)) {
            return false;
        }

        if (null == packWrap) {
            if (null != spInfo.packWrap) {
                return false;
            }
        } else if (!packWrap.equals(spInfo.packWrap)) {
            return false;
        }

        if (null == batchNum) {
            if (null != spInfo.batchNum) {
                return false;
            }
        } else if (!batchNum.equals(spInfo.batchNum)) {
            return false;
        }

        if (null == approvalNum) {
            if (null != spInfo.approvalNum) {
                return false;
            }
        } else if (!approvalNum.equals(spInfo.approvalNum)) {
            return false;
        }

        if (null == memo) {
            if (null != spInfo.memo) {
                return false;
            }
        } else if (!memo.equals(spInfo.memo)) {
            return false;
        }

        if (null == gysName) {
            if (null != spInfo.gysName) {
                return false;
            }
        } else if (!gysName.equals(spInfo.gysName)) {
            return false;
        }

        return true;
    }
}
